realtek: mdio-serdes: improve debugfs creation
authorJonas Jelonek <[email protected]>
Tue, 16 Dec 2025 10:20:13 +0000 (10:20 +0000)
committerRobert Marko <[email protected]>
Tue, 16 Dec 2025 12:12:15 +0000 (13:12 +0100)
commit2e56a1ffc6914d60201fa3fce9b82e089148feb4
treedb5a732feadc0e9bedfdeeb89a0cffcddd93a635
parent86ebe649c27f97fc298f034da2d6a96fd61cdc5c
realtek: mdio-serdes: improve debugfs creation

Commit 3c073b5cb2 cleaned up the debugfs creation in
mdio-realtek-otto-serdes driver to not explicitly check if the root
directory already exists. This is fine because kernel handles the case
properly so there's no need to check anymore.

However, this pollutes the boot log with:
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'

Now, the root directory creation is attempted multiple times, causing
the kernel to print an error message because the directory already
exists.

Fix this by moving the SerDes loop into rtsds_debug_init and only try
to create the root debugfs directory once.

Signed-off-by: Jonas Jelonek <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/21179
Signed-off-by: Robert Marko <[email protected]>
(cherry picked from commit 8e4730fd60a1b4998d1c9c07aeb6c6a27bce210f)
target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c